﻿package com.janisRadins.asDraw.vo {
	import com.janisRadins.asDraw.ICurve;
	import flash.geom.Point;
	/**
	 * Class that holds values for Curve position in curve collection
	 * @author Jānis Radiņš
	 */
	public class CurveData {
		/** @private */
		protected var _coordinates:Point = null;
		/** @private */
		protected var _startLength:Number = NaN;
		/** @private */
		protected var _curve:ICurve = null;
		/** @private */
		protected var _index:uint = 0;
		
		/**
		 * @param	coordinates
		 * @param	startLength
		 * @param	curve
		 * @param	index
		 */
		public function CurveData(coordinates:Point, startLength:Number, curve:ICurve, index:uint) {
			_coordinates = coordinates;
			_startLength = startLength;
			_curve = curve;
			_index = index;
		}
		/**
		 * Point with x and y coordinates of curve inside Path
		 */
		public function get coordinates():Point {
			return _coordinates;
		}
		/**
		 * Path length value on Curve begining
		 */
		public function get startLength():Number {
			return _startLength;
		}
		/**
		 * Reference to Curve instance
		 */
		public function get curve():ICurve {
			return _curve;
		}
		/**
		 * Curve index inside collection
		 */
		public function get index():uint {
			return _index;
		}
		/** @private */
		public function toString():String {
			return "CurvePosition [coordinates:" + _coordinates + ", startLength:" + _startLength + ", curve:" + _curve + ", index: " + _index + "]";
		}
	}
}